#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define ep emplace
#define rep(i, x, y) for(int i = (x); i <= (y); i++) 
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using ll = long long;
using db = double;
using pii = pair < int , int >;
using vec = vector < int >;
using veg = vector < pii >;

int read() {
	int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-', ch = getchar(); 
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = getchar(); return f ? -x : x;
}

const int N = 55;
const int mod = 998244353;

int n, K, L[N], R[N], inv[110], C[N][N];
vec f[N][N];

ll qp(ll x, int t = mod - 2) { ll res = 1; for(; t; t >>= 1, x = x * x % mod) if(t & 1) res = res * x % mod; return res; }
int upd(int x) { return x + (x >> 31 & mod); }
vec I() { vec arr; arr.resize(1); arr[0] = 1; return arr; }
vec mul(vec f, int k, int b) {
	//if(k || b) cerr << "!" << k << " " << b << endl;
	vec res; res.resize(f.size() + 1);
	rep(i, 0, int(f.size()) - 1) {
		res[i + 1] = upd(res[i + 1] + 1ll * f[i] * k % mod - mod);
		res[i] = upd(res[i] + 1ll * f[i] * b % mod - mod);
	} res[0] = 1ll * f[0] * b % mod; return res;
}
vec add(vec a, vec b) {
	vec t; t.resize(max(a.size(), b.size()));
	rep(i, 0, (int)t.size() - 1) {
		t[i] = upd((i < a.size() ? a[i] : 0) + (i < b.size() ? b[i] : 0) - mod);
	} return t;
}
vec Int(vec a) {
	vec t; t.resize((int)a.size() + 1);
	rep(i, 1, (int)a.size()) t[i] = 1ll * a[i - 1] * inv[i] % mod;
	return t;
}
int Eval(vec a, int x) {
	int res = 0; reverse(a.begin(), a.end());
	for(auto v : a) res = upd(1ll * res * x % mod + v - mod);
	return res;
}

int ans;

int main() {
#ifndef ONLINE_JUDGE
	freopen("1.in", "r", stdin);
#endif
	n = in, K = n - in + 1;
	rep(i, 1, n) L[i] = in, R[i] = in;
	rep(i, 0, n) C[i][0] = 1; 
	rep(i, 1, n) rep(j, 1, i) C[i][j] = upd(C[i - 1][j - 1] + C[i - 1][j] - mod);
	inv[1] = inv[0] = 1; rep(i, 2, 100) inv[i] = 1ll * (mod - mod / i) * inv[mod % i] % mod;
	rep(tval, 1, 100) {
		f[0][0] = I();
		rep(i, 1, n) {
			rep(j, 1, i)
			f[i][j] =
			add(f[i - 1][j], L[i] <= tval - 1 && R[i] >= tval ? mul(f[i - 1][j - 1], inv[R[i] - L[i]], 1ll * upd(-L[i]) * inv[R[i] - L[i]]) : f[i - 1][j - 1]);
			f[i][0] = f[i - 1][0];
		}
		int ans = 0; 
		rep(k, max(K - 1, 0), n) {
			int res = 0; vec t = Int(f[n][k]);
			res = upd(Eval(t, tval) - Eval(t, tval - 1));
			if(t.size()) cerr << tval << " " << t.size() << " " << res << endl;
			if((k & 1) == (K & 1)) ans = upd(ans + 1ll * res * C[k][K - 1] % mod - mod);
			else ans = upd(ans - 1ll * res * C[k][K - 1] % mod);
		}
	}
	printf("%d\n", ans);
	return 0;
}
